<style>
    .xh-form .btn{
        margin-right: 0px;
    }
    .xh-form tr td:nth-child(2n){
        padding: 5px 20px 5px 0;
    }
    td >label{
        float: right;
        margin-right: 10px;
    }
    body{
        background-color: #f9f9f9;
    }
    #prodList  th {
        text-align: center;
        vertical-align: middle !important;
    }
</style>

<script>
    var formData = {% if formData is defined %} {{ formData | json_encode }} {% else %} null {% endif %};
    var parts = {{ parts | json_encode }};
</script>

{% if powerScript is defined %}
    {{ powerScript }}
{% endif %}
<form id="xh_form" class="xh-form"  method="post"    style="margin-left: 20px;">
    <div class="xh-area-form">
        <table>
            <tr>
                <td style="width: 75px;"><label >商品名称</label></td>
                <td style="width: 200px;"><input name="sProdName" ><input type="hidden" name="iProdAttr" value="2"></td>
                <td style="width: 75px;"><label>商品分类</label></td>
                <td style="width: 200px;">
                    <select name="iPTId" >
                        <option value="" style="display: none">请选择(可不选)</option>
                        {% for id,text in prodTypes %}
                            {% if iPTId is defined and id == iPTId %}
                                <option value="{{ id }}" selected>{{ text }}</option>
                            {% elseif text == '自定义商品' %}
                                <option value="{{ id }}" selected>{{ text }}</option>
                            {% else %}
                                <option value="{{ id }}">{{ text }}</option>
                            {% endif %}
                        {% endfor %}
                    </select>
                </td>
            </tr>
            <tr>
                <td><label>销售价</label></td>
                <td><input class="doubleInput" type="number" name="dOutPrice" step="0.01" placeholder="保留小数点后两位"></td>
            </tr>
            <tr>
               <td colspan="4">
                   <table id="prodList" class="table">
                       <tr class="info" >
                           <th style="width: 50%;">商品名称</th>
                           <th style="width: 25%">库存数量</th>
                           <th style="width: 25%">组成数量</th>
                       </tr>
                       <tr  class="modelTr" >
                           <td>
                               <select class="prodName"  style="width: 250px;">
                                   <option value="" selected>请选择</option>
                                   {% for id,text in parts %}
                                       <option value="{{ id }}">{{ text }}</option>
                                   {% endfor %}
                               </select>
                           </td>
                           <td><label class="resNum" style="line-height: 3">--</label></td>
                           <td><input class="num" type="number" min="0" placeholder="只填写数目" step="1"></td>
                       </tr>
                       <tr>
                           <td colspan="3"><a id="addBtn" class="btn btn-default" style="float: right;">新增</a></td>
                       </tr>
                   </table>
               </td>
            </tr>
        </table>
    </div>
</form>

